package com.haopt.clock.controller;

import com.haopt.clock.dto.ResultDTO;
import com.haopt.clock.service.UserService;
import com.haopt.clock.vo.ReqApplicationVO;
import com.haopt.clock.vo.ReqUserAddVO;
import com.haopt.clock.vo.ReqUserApplicationPageVO;
import com.haopt.clock.vo.ResUserAddVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author haopt
 * @version 1.0
 * @ClassName UserController
 * @Description TODO
 * @date 2021/3/21 20:31
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/add")
    public ResultDTO<ResUserAddVO> add(@RequestBody ReqUserAddVO vo) {
        return userService.add(vo);
    }

    @GetMapping("/getOpenId")
    public String getOpenId(@RequestParam("appId")String appId, @RequestParam("code")String code, @RequestParam("secret")String secret) {
        return userService.getOpenId(appId,code,secret);
    }

}
